import request  from '@/utils/request';
import { BASE_URL } from '@/config/query';
import { OPS_URL } from '@/config/query';

export async function update(params) {
  return request(`${BASE_URL}/owner_fire_location/modify`, params)
}

export async function queryPage(params) {
  return request(`${BASE_URL}/owner_fire_location/page`, params)
}

export async function queryInfoById(id) {
  return request(`${BASE_URL}/owner_fire_location/detail/${id}`)
}

export async function create(params) {
  return request(`${BASE_URL}/owner_fire_location/create`, params)
}

export async function remove(id) {
  return request(`${BASE_URL}/owner_fire_location/remove/${id}`)
}

export async function queryLocationList() {
  return request(`${BASE_URL}/build/list`)
}

export async function queryOptionList(params) {
  let url = params.url;
  delete params.url;
  return request(`${BASE_URL}/${ url }`, params)
}

export async function queryNameList(params) {
  return request(`${OPS_URL}/dict/permission_none/name`, params)
}

export async function queryTemple(params) {
  return request(`${BASE_URL}/help/page`, { ...params, pageSize: 100, pageNum: 1 })
}

export async function importFile({ url }) {
  return request(`${BASE_URL}/owner_fire_location/import`, { url })
}